<div id="page-wrapper">
	<div class="row">
		<div class="col-lg-12">
			<h3 class="page-header">
				<span>投票活动</span>
			</h3>
		</div>
		<!-- /.col-lg-12 -->
	</div>
	<!-- /.row -->
	<div class="row">
		<div class="col-lg-12">
			<div class="panel-group" id="accordion">
				<div class="panel panel-default">
					<div class="panel-heading">
						<h4 class="panel-title">
							<a data-toggle="collapse" data-parent="#accordion"
							href="#collapseOne">基本设置
						</a>
					</h4>
				</div>
				<div id="collapseOne" class="panel-collapse collapse in">
					<div class="panel-body">
						<div class="row">
							<div class="col-lg-6">
                                <form role="form" name="praise" method="post" action="{:U('User/Praise/update_praise')}" enctype="multipart/form-data">
									<input type="hidden" name="id" value="{$praise['id']}">
									<div class="form-group">
										<label>名称</label>
										<input class="form-control" name="title" value="{$praise['title']}" placeholder="请输入活动名称">
									</div>
                                    <div class="form-group">
                                        <label>图片</label>
                                        <present name="praise.picurl">
											<?php
												$picurlArr = explode(";",$praise['picurl']);
												if(!empty($picurlArr[0])){
												?>
													<img src="<php>echo $picurlArr[0]</php>"  class="thumbnail" width="100%" height="320px" data-preview="<php>echo uploadFile</php>">
													<input type="hidden" name="picurl" value="{$picurlArr[0]}" data-set="<php>echo uploadFile</php>">
													<input type="file" class="changePic" data-action="<php>echo uploadFile</php>"  style="margin-top: -10px;margin-bottom: 10px;">
												<?php }else{ ?>
													<img width="100%" height="200px" src="" alt=" " class="thumbnail preview" data-preview="uploadFile">
													<!-- <input type="hidden" name="picurl" value="{$praise['picurl']}" data-set="uploadFile"> -->
													<input name="picurl" type="file" data-action="uploadFile" style="margin-top: -10px;margin-bottom: 10px;">
											<?php }
											unset($picurlArr[sizeof($picurlArr)-1]);
											for($i = 1; $i < 3; $i++){
												if(isset($picurlArr[$i])){
												?>
											<img src="<php>echo $picurlArr[$i]</php>"  class="thumbnail" width="100%" height="320px" data-preview="<php>echo uploadFile.$i</php>">
											<input type="hidden" name="<php>echo 'picurl'.$i</php>" value="<php>echo $picurlArr[$i]</php>" data-set="<php>echo uploadFile.$i</php>">
											<input type="file" class="changePic" data-action="<php>echo uploadFile.$i</php>" style="margin-top: -10px;margin-bottom: 10px;">
											<?php }else{ ?>
											<img width="100%" height="200px" src="" alt=" " class="thumbnail preview" data-preview="<php>echo uploadFile.$i</php>">
											<!-- <input type="hidden" name="picurl" value="{$praise['picurl']}" data-set="uploadFile"> -->
											<input name="<php>echo 'picurl'.$i</php>" type="file" data-action="<php>echo uploadFile.$i</php>" style="margin-top: -10px;margin-bottom: 10px;">
											<?php }
											} ?>
                                        <else />
                                            <img width="100%" height="200px" src="" alt=" " class="thumbnail preview" data-preview="uploadFile">
                                            <!-- <input type="hidden" name="picurl" value="{$praise['picurl']}" data-set="uploadFile"> -->
                                            <input name="picurl" type="file" data-action="uploadFile" style="margin-top: -10px;margin-bottom: 10px;">
											<img width="100%" height="200px" src="" alt=" " class="thumbnail preview" data-preview="uploadFile1">
											<!-- <input type="hidden" name="picurl" value="{$praise['picurl']}" data-set="uploadFile"> -->
											<input name="picurl1" type="file" data-action="uploadFile1" style="margin-top: -10px;margin-bottom: 10px;">
											<img width="100%" height="200px" src="" alt=" " class="thumbnail preview" data-preview="uploadFile2">
											<!-- <input type="hidden" name="picurl" value="{$praise['picurl']}" data-set="uploadFile"> -->
											<input name="picurl2" type="file" data-action="uploadFile2" style="margin-top: -10px;">
                                        </present>
                                    </div>
                                    <div class="form-group">
                                        <label>每天可以为单幅作品投几票<span style="font-size:12px;color:red;margin-left:5px">＊如若忽略，请填-1</span></label>
										<input class="form-control" name="per_num" value="{$praise['per_num']}" placeholder="">
                                    </div>
                                    <div class="form-group">
                                        <label>活动期间内可以为单幅作品投几票<span style="font-size:12px;color:red;margin-left:5px">＊如若忽略，请填-1</span></label>
										<input class="form-control" name="per_num_sum" value="{$praise['per_num_sum']}" placeholder="">
                                    </div>
                                    <div class="form-group">
                                        <label>每天可以给多少幅作品投票<span style="font-size:12px;color:red;margin-left:5px">＊如若忽略，请填-1</span></label>
										<input class="form-control" name="sum_num" value="{$praise['sum_num']}" placeholder="">
                                    </div>
                                    <div class="form-group">
                                        <label>活动期间总共可以投多少票<span style="font-size:12px;color:red;margin-left:5px">＊如若忽略，请填-1</span></label>
										<input class="form-control" name="limit_sum" value="{$praise['limit_sum']}" placeholder="">
                                    </div>
									<div class="form-group">
										<label>活动开始时间</label>
										<input class="form-control date-picker" name="startdate" value="{$praise['startdate']|date='Y-m-d H:i:s', ###}" placeholder="请输入活动开始时间">
									</div>
									<div class="form-group">
										<label>活动结束时间</label>
										<input class="form-control date-picker" name="enddate" value="{$praise['enddate']|date='Y-m-d H:i:s', ###}" placeholder="请输入活动结束时间">
									</div>
									<div class="form-group">
										<label>是否强制关注：</label>
										<input name="showpic" value="0" type="radio" <?php if(empty($praise) || empty($praise['showpic'])){ echo "checked";}?>>否
										<input name="showpic" value="1" type="radio" <?php if(!empty($praise) && !empty($praise['showpic'])){ echo "checked";}?>>是
									</div>
									<div class="form-group">
										<label>投票类型：</label>
										<input name="type" value="scene" type="radio" <?php if(empty($praise) || ($praise['type'] == "scene")){ echo "checked";}?>>图片
										<input name="type" value="video" type="radio" <?php if(!empty($praise) && ($praise['type'] == "video")){ echo "checked";}?>>视频
									</div>
									<div class="form-group">
										<label>投票类型：</label>
										<input name="style" value="1" type="radio" <?php if(empty($praise) || ($praise['style'] == "1")){ echo "checked";}?>>投票
										<input name="style" value="2" type="radio" <?php if(!empty($praise) && ($praise['style'] == "2")){ echo "checked";}?>>点赞
									</div>
									<button type="submit" class="btn btn-default">保存</button>
								</form>
							</div>
							<!-- /.col-lg-6 (nested) -->
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</div>
<!-- /#page-wrapper -->
<style type="text/css">
	.blue-font {
		color: #337ec3;
	}
</style>
<script type="text/javascript" src="/Public/js/common.upload.js"></script>
<script type="text/javascript">
    common.upload.img.init();
</script>
<script type="text/javascript" src="/Public/js/laydate/laydate.js"></script>
<script type="text/javascript">
$( ".date-picker" ).bind( "click", function(){
	laydate( {
    	format: 'YYYY/MM/DD hh:mm:ss',
    	min: laydate.now(), //设定最小日期为当前日期
    	max: '2099-06-16 23:59:59', //最大日期
    	istime: true,
    	istoday: false
	} );
	laydate.skin( "molv" );
});
</script>
